package com.mfangsoft.zhuangjialong.integration.usermanage.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.mfangsoft.zhuangjialong.common.model.Page;
import com.mfangsoft.zhuangjialong.common.utils.stereotype.WriterRepository;
import com.mfangsoft.zhuangjialong.integration.usermanage.model.SellerPointEntity;
import com.mfangsoft.zhuangjialong.integration.usermanage.model.UserManagerTask;
import com.mfangsoft.zhuangjialong.integration.usermanage.model.UserManagerTaskModel;
@WriterRepository
public interface UserManagerTaskMapper {
    /**
     * 通过主键删除  
     *
     * @MLTH_generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 插入数据  
     *
     * @MLTH_generated
     */
    int insert(UserManagerTask record);

    int insertSelective(UserManagerTask record);

    /**
     * 通过主键查询数据 
     *
     * @MLTH_generated
     */
    UserManagerTask selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserManagerTask record);

    /**
     * 通过主键更新数据  
     *
     * @MLTH_generated
     */
    int updateByPrimaryKey(UserManagerTask record);

    /**
     * 人员任务的批量设置
     * @param map
     */
	void addUerManagerTaskBatch(Map<String, Object> map);

	/**
	 * 人员的任务查看
	 * @param param
	 * @return
	 */
	List<UserManagerTaskModel> selectUerManagerTaskForPage(Page<UserManagerTaskModel> param);

	/**
	 * 人员任务的详情
	 * @param task_id
	 * @return
	 */
	UserManagerTaskModel selectUerManagerTaskDetails(@Param(value = "task_id") Long task_id,@Param(value = "userManager_id") Long userManager_id);

	/**
	 * 人员的工作台当前任务
	 * @param page
	 * @return
	 */
	List<UserManagerTaskModel> selectPresentUerManagerTaskForPage(Page<UserManagerTaskModel> page);

	/**
	 * 查看活动的
	 * @param activity_id
	 * @return
	 */
	Map<String, Object> selectActivityTime(Long activity_id);

	/**
	 * 根据导购id和活动id查看任务是否已经设置
	 * @param userManagerId
	 * @param activity_id
	 * @return
	 */
	UserManagerTask selectTaskByUserManagerId(@Param(value = "userManagerId") Integer userManagerId, @Param(value = "activity_id") Long activity_id);

	/**
	 * 根据分公司id和活动id查看为参与该活动的导购
	 * @param activity_id
	 * @param currentUserId
	 * @return
	 */
	List<Map<String, Object>> selectUserManagerByActivityIdAndUserId(@Param(value = "activity_id") Long activity_id, @Param(value = "user_id") Long user_id);
}